In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('seaborn')
In [2]:
# pd.DataFrame? question mark can return documentation in Jupyter
# pd.DataFrame?? for source code
from jupyterworkflow.data import get_data
In [3]:
data = get_data()
data.head()
Out[3]:
In [4]:
data.resample('W').sum().plot();
# ax.set_ylim(0, None);
In [5]:
data.groupby(data.index.time).mean().plot();
In [6]:
pivoted = data.pivot_table('Total', index=data.index.time, columns=data.index.date)
pivoted.iloc[:5, :5]
Out[6]:
In [7]:
pivoted.plot(legend=False, alpha=0.01); #Transparency
Making a note to describe the purpose of Pytest. When packaging a function, you want to make sure it does what it set out to accomplish. Unit tests provide a validation, and are especially useful when testing out new code.
The interesting part is that it also provides a speed test of sorts to determine how efficient the function was for its purposes.
python -m pytest jupyterworkflow/
In [ ]: